package com.youku.bootstrap;

import java.util.HashMap;
import java.util.Map;

import com.youku.util.Consts;

public class PlatformExecutorHolder {

	private static final Map<String,PlatformExecutor> executorMap;
	
	static{
		executorMap=new HashMap<>();
		
		executorMap.put(Consts.IMMEDIATE_COMMAND, new ImmediateExecutor());
		
		executorMap.put(Consts.REGULAR_COMMAND, new RegularExecutor());
	}
	
	public static final boolean isLegalCommand(String command){
		return executorMap.containsKey(command);
	}
	
	public static final PlatformExecutor getExecutor(String command){
		return executorMap.get(command);
	}
}
